﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<dynamic>" %>

<div id="search">
<form id="searchfriend" method="post" onsubmit="return CheckLength();" action="/Search/SearchFriendList?isSameSchool=true">
<input type="text" name="name" id="searchinput" value="输入要查找的好友名字……" /><a ><img id="bigmirror" src="../../Content/Images/mainpage/search/bigmirror.png" /></a>
</form>
</div>

<script type="text/javascript">
    function CheckLength() {
        var data = $('#searchinput').val()
        if (data.length > 1 && data.length < 10) {

            return true;
        }
        else
        { jAlert('输入的名字需在2-10间', 'School Party'); return true; }
    }

    $(document).ready(function () {
       


        $('#searchinput').bind("keydown", function (e) {
            if (e.keyCode == 13) {
                var data = $('#searchinput').val()
                if (data.length > 1 && data.length < 10) {
                    $('#searchfriend').submit();

                }
                else {
                    jAlert('输入的名字需在2-10间', 'School Party');


                }
            }

        });
    });
</script>


<script type="text/javascript">
    $(document).ready(function () {
        $('#diaryarea').keyup(function () {
            var left = $('#diaryarea').val().length;
            $('#fontcount').text(left);
        });

        $('#searchinput').focus(function () {
            if ($(this).val() == "输入要查找的好友名字……")
                $(this).val("");
        });

        $('#searchinput').blur(function () {
            if ($(this).val() == "")
                $(this).val("输入要查找的好友名字……");
        });



    });//end of document
</script>


<%--------------------------------------------%>

